/******************************************************** 
The below code replicates the tables for the paper: The impact of social distancing on trading activity during the COVID-19 pandemic. Financial Management, forthcoimg.

If you use the code or the data, please cite: Sabah, N. (2024). The impact of social distancing on trading activity during the COVID-19 pandemic. Financial Management, 1–33. https://doi.org/10.1111/fima.12456

Description: 
Stata dataset needed: Merged_all.dta
Construction of all the variables are described in the dataset.
*********************************************************/

clear all
cd "C:\FM Submission\Code Sharing\"

use "C:\FM Submission\Code Sharing\Merged_all.dta", replace

 
egen stock_id=group(cusip)
egen date_symbol=group(date cusip)

replace size=size/1000000
gen size_small=0
replace size_small=1 if r_size<=2
gen size_big=0
replace size_big=1 if r_size>=7

gen rec_low=0
replace rec_low=1 if r_numrec_nonzero==0
gen rec_high=0
replace rec_high=1 if r_numrec_nonzero==4

gen transparency = 1/ opaque
gen low_opaque=0
replace low_opaque=1 if opaque_rank<=2
gen high_opaque=0
replace high_opaque=1 if opaque_rank>=7

gen roa_low=0
replace roa_low=1 if r_roa==0
gen roa_high=0
replace roa_high=1 if r_roa==4

gen high_sciov=0
replace high_sciov=1 if r_fsci_ov>=7
gen low_sciov=0
replace low_sciov=1 if r_fsci_ov<=2

gen rec_low2=0
replace rec_low2=1 if r_numrec<=2
gen rec_high2=0
replace rec_high2=1 if r_numrec==7

gen high_lc2=0
replace high_lc2=1 if r_lc>=8
gen low_lc2=0
replace low_lc2=1 if r_lc<=1

replace price = price /100
replace tradesize = (vol/numtrd)/1000
replace dollar_vol = dollar_vol/1000000000

replace aoib = aoib*1000
replace l1_aoib = l1_aoib*1000 

replace basprd=basprd*100
replace abquotedspread2 = abquotedspread2*100



 
/*Table 1: Summary Stats (Look at SAS code)*/
/* Size in trillions, AOIB is multiplied by 10 times,  */
tabstat ablognumtrd ablogvol ablogdvol stayput changeinmovement size transparency roa sci_ov lc ea aoib amihud basprd abquotedspread2 whbrief volatility abcret5to1 abcret30to6  price tradesize dollar_vol , stat(n mean sd p25 median p75)
 
/*Table 2: Key Results*/

areg ablognumtrd stayput l1_ablognumtrd whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store col_1 
	estadd local fe Yes

areg ablogvol stayput l1_ablogvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store col_2 
	estadd local fe Yes

areg ablogdvol stayput l1_ablogdvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store col_3 
	estadd local fe Yes

areg ablognumtrd changeinmovement l1_ablognumtrd whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store col_4 
	estadd local fe Yes

areg ablogvol changeinmovement l1_ablogvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store col_5 
	estadd local fe Yes

areg ablogdvol changeinmovement l1_ablogdvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store col_6 
	estadd local fe Yes
	
estout * using Table_2.xls , cells(b(fmt(3) star) se(par([ ]))) starlevels( * 0.10 ** 0.05 *** 0.010)  stats(fe N r2_a, labels("Firm FE" "Obs" "Adjusted R^2")) varlabels(_cons Constant)  replace
estimates clear


//* Table 3: Size *//

areg ablognumtrd stayput c.stayput#1.size_small c.stayput#1.size_big size_small size_big l1_ablognumtrd whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store col_1
	estadd local fe Yes

areg ablogvol stayput c.stayput#1.size_small c.stayput#1.size_big size_small size_big l1_ablogvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store col_2
	estadd local fe Yes

areg ablogdvol stayput c.stayput#1.size_small c.stayput#1.size_big size_small size_big l1_ablogdvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store col_3
	estadd local fe Yes

//
areg ablognumtrd changeinmovement c.changeinmovement#1.size_small c.changeinmovement#1.size_big size_small size_big l1_ablognumtrd whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store col_4
	estadd local fe Yes

areg ablogvol changeinmovement c.changeinmovement#1.size_small c.changeinmovement#1.size_big size_small size_big l1_ablognumtrd whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store col_5
	estadd local fe Yes

areg ablogdvol changeinmovement c.changeinmovement#1.size_small c.changeinmovement#1.size_big size_small size_big l1_ablogdvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store col_6
	estadd local fe Yes

estout * using Table_3.xls , cells(b(fmt(3) star) se(par([ ]))) starlevels( * 0.10 ** 0.05 *** 0.010)  stats(fe N r2_a, labels("Firm FE" "Obs" "Adjusted R-squared")) varlabels(_cons Constant)  replace
estimates clear


/* Table 4: Analysts Coverage as firm visibility  */

/* Panel A */
areg ablognumtrd stayput c.stayput#rec_zero l1_ablognumtrd whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store col_1
	estadd local fe Yes

areg ablogvol stayput c.stayput#rec_zero l1_ablogvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store col_2
	estadd local fe Yes

areg ablogdvol stayput c.stayput#rec_zero l1_ablogdvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store col_3
	estadd local fe Yes

areg ablognumtrd changeinmovement c.changeinmovement#rec_zero l1_ablognumtrd whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store col_4
	estadd local fe Yes

areg ablogvol changeinmovement c.changeinmovement#rec_zero l1_ablogvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store col_5
	estadd local fe Yes

areg ablogdvol changeinmovement c.changeinmovement#rec_zero l1_ablogdvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store col_6
	estadd local fe Yes


	
/* Panel B */
areg ablognumtrd c.stayput#r_numrec_nonzero l1_ablognumtrd whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store col_7
	estadd local fe Yes

areg ablogvol c.stayput#r_numrec_nonzero l1_ablogvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store col_8
	estadd local fe Yes

areg ablogdvol c.stayput#r_numrec_nonzero l1_ablogdvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store col_9
	estadd local fe Yes

areg ablognumtrd c.changeinmovement#r_numrec_nonzero l1_ablognumtrd whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store col_10
	estadd local fe Yes

areg ablogvol c.changeinmovement#r_numrec_nonzero l1_ablogvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store col_11
	estadd local fe Yes

areg ablogdvol c.changeinmovement#r_numrec_nonzero l1_ablogdvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store col_12
	estadd local fe Yes

estout * using Table_4.xls , cells(b(fmt(3) star) se(par([ ]))) starlevels( * 0.10 ** 0.05 *** 0.010)  stats(fe N r2_a, labels("Firm FE" "Obs" "Adjusted R-squared")) varlabels(_cons Constant)  replace
estimates clear
	

/* Table 5: Firm Opaqueness/Transparency in financial reporting  */


areg ablognumtrd stayput c.stayput#high_opaque c.stayput#low_opaque high_opaque low_opaque l1_ablognumtrd whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store vol_1
	estadd local fe Yes
test c.stayput#1.high_opaque = c.stayput#1.low_opaque

areg ablogvol stayput c.stayput#high_opaque c.stayput#low_opaque high_opaque low_opaque l1_ablogvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store vol_2
	estadd local fe Yes
test c.stayput#1.high_opaque = c.stayput#1.low_opaque

areg ablogdvol stayput c.stayput#high_opaque c.stayput#low_opaque high_opaque low_opaque l1_ablogdvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store vol_3
	estadd local fe Yes
test c.stayput#1.high_opaque = c.stayput#1.low_opaque

//
areg ablognumtrd changeinmovement c.changeinmovement#high_opaque c.changeinmovement#low_opaque high_opaque low_opaque l1_ablognumtrd whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store vol_4
	estadd local fe Yes
test c.changeinmovement#1.high_opaque = c.changeinmovement#1.low_opaque

areg ablogvol changeinmovement c.changeinmovement#high_opaque c.changeinmovement#low_opaque high_opaque low_opaque l1_ablogvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store vol_5
	estadd local fe Yes
test c.changeinmovement#1.high_opaque = c.changeinmovement#1.low_opaque

areg ablogdvol changeinmovement c.changeinmovement#high_opaque c.changeinmovement#low_opaque high_opaque low_opaque l1_ablogdvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store vol_6
	estadd local fe Yes
test c.changeinmovement#1.high_opaque = c.changeinmovement#1.low_opaque

	
estout * using Table_5.xls , cells(b(fmt(3) star) se(par([ ]))) starlevels( * 0.10 ** 0.05 *** 0.010)  stats(fe N r2_a, labels("Firm FE" "Obs" "Adjusted R-squared")) varlabels(_cons Constant)  replace
estimates clear


/* Table 6: Profitability (ROA) */

areg ablognumtrd stayput c.stayput#roa_low c.stayput#roa_high   l1_ablognumtrd whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store vol_1
	estadd local fe Yes


areg ablogvol stayput c.stayput#roa_low c.stayput#roa_high   l1_ablogvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store vol_2
	estadd local fe Yes


areg ablogdvol stayput c.stayput#roa_low c.stayput#roa_high   l1_ablogdvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store vol_3
	estadd local fe Yes


areg ablognumtrd changeinmovement c.changeinmovement#roa_low c.changeinmovement#roa_high   l1_ablognumtrd whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store vol_4
	estadd local fe Yes


areg ablogvol changeinmovement c.changeinmovement#roa_low c.changeinmovement#roa_high   l1_ablogvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store vol_5
	estadd local fe Yes


areg ablogdvol changeinmovement c.changeinmovement#roa_low c.changeinmovement#roa_high   l1_ablogdvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store vol_6
	estadd local fe Yes
	
estout * using Table_6.xls , cells(b(fmt(3) star) se(par([ ]))) starlevels( * 0.10 ** 0.05 *** 0.010)  stats(fe N r2_a, labels("Firm FE" "Obs" "Adjusted R-squared")) varlabels(_cons Constant)  replace
estimates clear




/* Table 7: County Level Information Friction:  */

/* Panel A: CS = Size */

/* FSCI: Social Connectedness */

areg ablognumtrd c.sci_ov#1.size_small c.sci_ov#1.size_big sci_ov size l1_ablognumtrd whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store vol_1
	estadd local fe Yes
test c.sci_ov#1.size_small = c.sci_ov#1.size_big

areg ablogvol c.sci_ov#1.size_small c.sci_ov#1.size_big sci_ov size l1_ablogvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store vol_2
	estadd local fe Yes
test c.sci_ov#1.size_small = c.sci_ov#1.size_big

areg ablogdvol c.sci_ov#1.size_small c.sci_ov#1.size_big sci_ov size l1_ablogdvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store vol_3
	estadd local fe Yes
test c.sci_ov#1.size_small = c.sci_ov#1.size_big


/* LC: Local Concentration */

areg ablognumtrd 1.high_lc2#1.size_small 1.low_lc2#1.size_big lc size l1_ablognumtrd whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store vol_4
	estadd local fe Yes
test 1.high_lc2#1.size_small = 1.low_lc2#1.size_big

areg ablogvol 1.high_lc2#1.size_small 1.low_lc2#1.size_big  size l1_ablogvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store vol_5
	estadd local fe Yes
test 1.high_lc2#1.size_small = 1.low_lc2#1.size_big

areg ablogdvol 1.high_lc2#1.size_small 1.low_lc2#1.size_big  size l1_ablogdvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store vol_6
	estadd local fe Yes
test 1.high_lc2#1.size_small = 1.low_lc2#1.size_big

/* EA: Earnings Announcements */

areg ablognumtrd 1.ea#1.size_small 1.ea#1.size_big ea size_big size_small l1_ablognumtrd whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store vol_7
	estadd local fe Yes
test  1.ea#1.size_small = 1.ea#1.size_big

areg ablogvol 1.ea#1.size_small 1.ea#1.size_big ea size_big size_small l1_ablogvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store vol_8
	estadd local fe Yes
test  1.ea#1.size_small = 1.ea#1.size_big

areg ablogdvol 1.ea#1.size_small 1.ea#1.size_big ea size_big size_small l1_ablogdvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store vol_9
	estadd local fe Yes
test  1.ea#1.size_small = 1.ea#1.size_big

estout * using Table_7A.xls , cells(b(fmt(3) star) se(par([ ]))) starlevels( * 0.10 ** 0.05 *** 0.010)  stats(fe N r2_a, labels("Firm FE" "Obs" "Adjusted R-squared")) varlabels(_cons Constant)  replace
estimates clear


/* Panel B: CS = Analyts's Coverage */

/* FSCI: Social Connectedness */

areg ablognumtrd c.sci_ov#1.rec_low c.sci_ov#1.rec_high sci_ov numrec l1_ablognumtrd whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store vol_1
	estadd local fe Yes
test c.sci_ov#1.rec_low = c.sci_ov#1.rec_high

areg ablogvol c.sci_ov#1.rec_low c.sci_ov#1.rec_high sci_ov numrec l1_ablogvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store vol_2
	estadd local fe Yes
test c.sci_ov#1.rec_low = c.sci_ov#1.rec_high

areg ablogdvol c.sci_ov#1.rec_low c.sci_ov#1.rec_high sci_ov numrec l1_ablogdvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store vol_3
	estadd local fe Yes
test c.sci_ov#1.rec_low = c.sci_ov#1.rec_high


/* LC: Local Concentration */

areg ablognumtrd 1.high_lc2#1.rec_low2 1.low_lc2#1.rec_high2 lc numrec l1_ablognumtrd whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estadd local fe Yes
	test 1.high_lc2#1.rec_low2 = 1.low_lc2#1.rec_high2
	estimates store vol_4

areg ablogvol 1.high_lc2#1.rec_low2 1.low_lc2#1.rec_high2 lc numrec l1_ablogvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store vol_5
	estadd local fe Yes
test 1.high_lc2#1.rec_low2 = 1.low_lc2#1.rec_high2

areg ablogdvol 1.high_lc2#1.rec_low2 1.low_lc2#1.rec_high2 lc numrec l1_ablogdvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store vol_6
	estadd local fe Yes
test 1.high_lc2#1.rec_low2 = 1.low_lc2#1.rec_high2


/* EA: Earnings Announcements */

areg ablognumtrd 1.ea#1.rec_low2 1.ea#1.rec_high2 ea numrec l1_ablognumtrd whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store vol_7
	estadd local fe Yes
test 1.ea#1.rec_low2 = 1.ea#1.rec_high2

areg ablogvol 1.ea#1.rec_low2 1.ea#1.rec_high2 ea numrec l1_ablogvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store vol_8
	estadd local fe Yes
test 1.ea#1.rec_low2 = 1.ea#1.rec_high2

areg ablogdvol 1.ea#1.rec_low2 1.ea#1.rec_high2 ea numrec l1_ablogdvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store vol_9
	estadd local fe Yes
test 1.ea#1.rec_low2 = 1.ea#1.rec_high2

estout * using Table_7B.xls , cells(b(fmt(3) star) se(par([ ]))) starlevels( * 0.10 ** 0.05 *** 0.010)  stats(fe N r2_a, labels("Firm FE" "Obs" "Adjusted R-squared")) varlabels(_cons Constant)  replace
estimates clear


/* Panel C: CS = Transparency */

/* FSCI: Social Connectedness */

areg ablognumtrd c.sci_ov#1.high_opaque c.sci_ov#1.low_opaque sci_ov low_opaque  high_opaque l1_ablognumtrd whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)	
	estimates store vol_1
	estadd local fe Yes
test c.sci_ov#1.high_opaque = c.sci_ov#1.low_opaque

areg ablogvol c.sci_ov#1.high_opaque c.sci_ov#1.low_opaque sci_ov low_opaque  high_opaque  high_opaque l1_ablogvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)	
	estimates store vol_2
	estadd local fe Yes
test c.sci_ov#1.high_opaque = c.sci_ov#1.low_opaque

areg ablogdvol c.sci_ov#1.high_opaque c.sci_ov#1.low_opaque sci_ov low_opaque  high_opaque l1_ablogdvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)	
	estimates store vol_3
	estadd local fe Yes
test c.sci_ov#1.high_opaque = c.sci_ov#1.low_opaque


/* LC: Local Concentration */

areg ablognumtrd 1.high_lc2#1.high_opaque 1.low_lc2#1.low_opaque low_opaque  high_opaque l1_ablognumtrd whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store vol_4
	estadd local fe Yes
test 1.high_lc2#1.high_opaque = 1.low_lc2#1.low_opaque

areg ablogvol 1.high_lc2#1.high_opaque 1.low_lc2#1.low_opaque low_opaque  high_opaque l1_ablogvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store vol_5
	estadd local fe Yes
test 1.high_lc2#1.high_opaque = 1.low_lc2#1.low_opaque

areg ablogdvol 1.high_lc2#1.high_opaque 1.low_lc2#1.low_opaque low_opaque  high_opaque l1_ablogdvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store vol_6
	estadd local fe Yes
test 1.high_lc2#1.high_opaque = 1.low_lc2#1.low_opaque


/* EA: Earnings Announcements */

areg ablognumtrd 1.ea#1.high_opaque 1.ea#1.low_opaque ea high_opaque low_opaque l1_ablognumtrd whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store vol_7
	estadd local fe Yes
test  1.ea#1.high_opaque = 1.ea#1.low_opaque

areg ablogvol 1.ea#1.high_opaque 1.ea#1.low_opaque ea high_opaque low_opaque  l1_ablogvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)	
	estimates store vol_8
	estadd local fe Yes
test  1.ea#1.high_opaque = 1.ea#1.low_opaque

areg ablogdvol 1.ea#1.high_opaque 1.ea#1.low_opaque ea high_opaque low_opaque l1_ablogdvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)	
	estimates store vol_9
	estadd local fe Yes
test  1.ea#1.high_opaque = 1.ea#1.low_opaque

estout * using Table_7C.xls , cells(b(fmt(3) star) se(par([ ]))) starlevels( * 0.10 ** 0.05 *** 0.010)  stats(fe N r2_a, labels("Firm FE" "Obs" "Adjusted R-squared")) varlabels(_cons Constant)  replace
estimates clear


/* Panel D: CS = Profitability */

/* FSCI: Social Connectedness */

reg ablognumtrd 1.low_sciov#1.roa_low 1.high_sciov#1.roa_high sci_ov roa l1_ablognumtrd whbrief volatility abcret5to1 abcret30to6, cluster(date_symbol)
	estimates store vol_1
	estadd local fe No
test 1.low_sciov#1.roa_low = 1.high_sciov#1.roa_high

reg ablogvol 1.low_sciov#1.roa_low 1.high_sciov#1.roa_high sci_ov roa l1_ablogvol whbrief volatility abcret5to1 abcret30to6, cluster(date_symbol)
	estimates store vol_2
	estadd local fe No
test 1.low_sciov#1.roa_low = 1.high_sciov#1.roa_high

reg ablogdvol 1.low_sciov#1.roa_low 1.high_sciov#1.roa_high sci_ov roa l1_ablogdvol whbrief volatility abcret5to1 abcret30to6, cluster(date_symbol)
	estimates store vol_3
	estadd local fe No
test 1.low_sciov#1.roa_low = 1.high_sciov#1.roa_high


/* LC: Local Concentration */

reg ablognumtrd 1.high_lc2#1.roa_low 1.low_lc2#1.roa_high lc roa l1_ablognumtrd whbrief volatility abcret5to1 abcret30to6, cluster(date_symbol)
	estimates store vol_4
	estadd local fe No
test 1.high_lc2#1.roa_low = 1.low_lc2#1.roa_high

reg ablogvol 1.high_lc2#1.roa_low 1.low_lc2#1.roa_high lc roa l1_ablogvol whbrief volatility abcret5to1 abcret30to6, cluster(date_symbol)
	estimates store vol_5
	estadd local fe No
test 1.high_lc2#1.roa_low = 1.low_lc2#1.roa_high

reg ablogdvol 1.high_lc2#1.roa_low 1.low_lc2#1.roa_high lc roa l1_ablogdvol whbrief volatility abcret5to1 abcret30to6, cluster(date_symbol)
	estimates store vol_6
	estadd local fe No
test 1.high_lc2#1.roa_low = 1.low_lc2#1.roa_high


/* EA: Earnings Announcements */

areg ablognumtrd 1.ea#1.roa_low 1.ea#1.roa_high ea l1_ablognumtrd whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store vol_7
	estadd local fe Yes
test  1.ea#1.roa_low = 1.ea#1.roa_high

areg ablogvol 1.ea#1.roa_low 1.ea#1.roa_high ea l1_ablogvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)	
	estimates store vol_8
	estadd local fe Yes
test  1.ea#1.roa_low = 1.ea#1.roa_high
	
areg ablogdvol 1.ea#1.roa_low 1.ea#1.roa_high ea l1_ablogdvol whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)	
	estimates store vol_9
	estadd local fe Yes
test  1.ea#1.roa_low = 1.ea#1.roa_high

estout * using Table_7D.xls , cells(b(fmt(3) star) se(par([ ]))) starlevels( * 0.10 ** 0.05 *** 0.010)  stats(fe N r2_a, labels("Firm FE" "Obs" "Adjusted R-squared")) varlabels(_cons Constant)  replace
estimates clear





/* Table 8: Absolute Order Imbalance */


/* Stay Put and CS*/


areg aoib  c.stayput#1.size_small c.stayput#1.size_big stayput size_small size_big l1_aoib whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store oib_1
	estadd local fe Yes
test c.stayput#1.size_small = c.stayput#1.size_big

areg aoib c.stayput#1.rec_low2 c.stayput#1.rec_high2 stayput rec_low2 rec_high2 l1_aoib whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store oib_2
	estadd local fe Yes
test c.stayput#1.rec_low = c.stayput#1.rec_high

areg aoib c.stayput#1.high_opaque c.stayput#1.low_opaque stayput low_opaque  high_opaque l1_aoib whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)	
	estimates store oib_3
	estadd local fe Yes
test c.stayput#1.high_opaque = c.stayput#1.low_opaque

areg aoib stayput c.stayput#1.roa_low c.stayput#1.roa_high roa l1_aoib whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store oib_4
	estadd local fe Yes
test c.stayput#1.roa_low = c.stayput#1.roa_high


/* Change in Movement and CS*/

areg aoib  c.changeinmovement#1.size_small c.changeinmovement#1.size_big changeinmovement size_small size_big l1_aoib whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store oib_5
	estadd local fe Yes
test c.changeinmovement#1.size_small = c.changeinmovement#1.size_big

areg aoib c.changeinmovement#1.rec_low2 c.changeinmovement#1.rec_high2 changeinmovement rec_low2 rec_high2 l1_aoib whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store oib_6
	estadd local fe Yes
test c.changeinmovement#1.rec_low = c.changeinmovement#1.rec_high

areg aoib c.changeinmovement#1.high_opaque c.changeinmovement#1.low_opaque changeinmovement low_opaque  high_opaque l1_aoib whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)	
	estimates store oib_7
	estadd local fe Yes
test c.changeinmovement#1.high_opaque = c.changeinmovement#1.low_opaque

areg aoib changeinmovement c.changeinmovement#roa_low c.changeinmovement#roa_high roa l1_aoib whbrief volatility abcret5to1 abcret30to6, absorb(stock_id) cluster(date_symbol)
	estimates store oib_8
	estadd local fe Yes
test c.changeinmovement#1.roa_low = c.changeinmovement#1.roa_high


estout * using Table_8.xls , cells(b(fmt(3) star) se(fmt(4))) starlevels( * 0.10 ** 0.05 *** 0.010)  stats(fe N r2_a, labels("Firm FE" "Obs" "Adjusted R-squared")) varlabels(_cons Constant)  replace
estimates clear


/* Table 9: Liquidity */

/* Amihud Illiquidity */

areg amihud stayput c.stayput#1.size_small c.stayput#1.size_big size_small size_big price tradesize dollar_vol volatility whbrief, absorb(stock_id) cluster(date_symbol)
	estimates store vol_1
	estadd local fe Yes
test c.stayput#1.size_small = c.stayput#1.size_big	

areg amihud stayput c.stayput#1.rec_low2 c.stayput#1.rec_high2 rec_low2 rec_high2 price tradesize dollar_vol volatility whbrief, absorb(stock_id) cluster(date_symbol)
	estimates store vol_2
	estadd local fe Yes
test c.stayput#1.rec_low2 = c.stayput#1.rec_high2

areg amihud stayput c.stayput#1.high_opaque  c.stayput#1.low_opaque high_opaque low_opaque price tradesize dollar_vol volatility whbrief, absorb(stock_id) cluster(date_symbol)
	estimates store vol_3
	estadd local fe Yes
test c.stayput#1.high_opaque = c.stayput#1.low_opaque

areg amihud stayput c.stayput#1.roa_low c.stayput#1.roa_high roa_low roa_high price tradesize dollar_vol volatility whbrief, absorb(stock_id) cluster(date_symbol)
	estimates store vol_4
	estadd local fe Yes
test c.stayput#1.roa_low = c.stayput#1.roa_high


/* Quoted Spread */

areg basprd stayput c.stayput#1.size_small c.stayput#1.size_big size_small size_big price tradesize dollar_vol volatility whbrief, absorb(stock_id) cluster(date_symbol)
	estimates store vol_5
	estadd local fe Yes
test c.stayput#1.size_small = c.stayput#1.size_big	

areg basprd stayput c.stayput#1.rec_low2 c.stayput#1.rec_high2 rec_low2 rec_high2 price tradesize dollar_vol volatility whbrief, absorb(stock_id) cluster(date_symbol)
	estimates store vol_6
	estadd local fe Yes
test c.stayput#1.rec_low2 = c.stayput#1.rec_high2

areg basprd stayput c.stayput#1.high_opaque  c.stayput#1.low_opaque high_opaque low_opaque price tradesize dollar_vol volatility whbrief, absorb(stock_id) cluster(date_symbol)
	estimates store vol_7
	estadd local fe Yes
test c.stayput#1.high_opaque = c.stayput#1.low_opaque

areg basprd stayput c.stayput#1.roa_low c.stayput#1.roa_high roa_low roa_high price tradesize dollar_vol volatility whbrief, absorb(stock_id) cluster(date_symbol)
	estimates store vol_8
	estadd local fe Yes
test c.stayput#1.roa_low = c.stayput#1.roa_high


/* Abnormal Spread */

areg abquotedspread2 stayput c.stayput#1.size_small c.stayput#1.size_big size_small size_big price tradesize dollar_vol volatility whbrief, absorb(stock_id) cluster(date_symbol)
	estimates store vol_9
	estadd local fe Yes
test c.stayput#1.size_small = c.stayput#1.size_big	

areg abquotedspread2 stayput c.stayput#1.rec_low2 c.stayput#1.rec_high2 rec_low2 rec_high2 price tradesize dollar_vol volatility whbrief, absorb(stock_id) cluster(date_symbol)
	estimates store vol_10
	estadd local fe Yes
test c.stayput#1.rec_low = c.stayput#1.rec_high

areg abquotedspread2 stayput c.stayput#1.high_opaque  c.stayput#1.low_opaque high_opaque low_opaque price tradesize dollar_vol volatility whbrief, absorb(stock_id) cluster(date_symbol)
	estimates store vol_11
	estadd local fe Yes
test c.stayput#1.high_opaque = c.stayput#1.low_opaque

areg abquotedspread2 stayput c.stayput#1.roa_low c.stayput#1.roa_high roa_low roa_high price tradesize dollar_vol volatility whbrief, absorb(stock_id) cluster(date_symbol)
	estimates store vol_12
	estadd local fe Yes
test c.stayput#1.roa_low = c.stayput#1.roa_high

estout * using Table_9.xls , cells(b(fmt(3) star) se(par([ ]))) starlevels( * 0.10 ** 0.05 *** 0.010)  stats(fe N r2_a, labels("Firm FE" "Obs" "Adjusted R-squared")) varlabels(_cons Constant)  replace
estimates clear
